﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
    ZFine.Domain.Entity.ChargingStandardEntity thisobj = ViewData["objs"] as ZFine.Domain.Entity.ChargingStandardEntity;
    //if (thisobj == null)
    //{
    //    thisobj = new ZFine.Domain.Entity.ChargingStandardEntity();
    //}
}

<script>
    var keyValue = $.request("keyValue");
    $(function () {
        //initControl();
        if (!!keyValue) {
            $.ajax({
                url: "/Project/ChargingStandard/GetFormJson",
                data: { keyValue: keyValue },
                dataType: "json",
                async: false,
                success: function(data) {
                    $("#form1").formSerialize(data);
                }
            });
        } else {
            $("#form1").formSerialize("add");
        }
    });

    //function initControl() {
    //    $("#F_NewType").bindSelect({
    //        url: "/SystemManage/ItemsData/GetSelectJson",
    //        param: { enCode: "NewsType" }
    //    });
    //}

    function submitForm() {
        debugger;
        var postData = $("#form1").formSerialize();
        debugger;
        $.submitForm({
            url: "/Project/ChargingStandard/SubmitForm?keyValue=" + keyValue,
            param: postData,
            success: function () {
                $.currentWindow().$("#gridList").trigger("reloadGrid");
            }
        });
    }
</script>
<form id="form1">
    <div class="widget-body">
        <div id="wizard" class="wizard" data-target="#wizard-steps" style="border-left: none; border-top: none; border-right: none;">
            <ul class="steps">
                <li data-target="#step-1" class="active">@*<span class="step">1</span>*@轮播图信息<span class="chevron"></span></li>
                @*<li data-target="#step-2"><span class="step">2</span>功能权限<span class="chevron"></span></li>*@
            </ul>
        </div>
        <div class="step-content" id="wizard-steps" style="border-left: none; border-bottom: none; border-right: none;">
            <div class="step-pane active" id="step-1" style="margin: 10px; margin-bottom: 0px;">
                <div class="panel panel-default">
                    <div class="panel-body" style="width: 98%;">
                        <table class="form">
                            <tr>
                                <th class="formTitle">标题:</th>
                                <td class="formValue">
                                    @{
                                        if (thisobj != null)
                                        {
                                            @thisobj.Name
                                        }
                                        else
                                        {
                                            <input id="Name" name="Name" type="text" class="form-control required" placeholder="请输入新闻标题"/>
                                        }
                                    }
                                </td>
                            </tr>
                            <tr>
                                <th class="formTitle">收费金额:</th>
                                <td class="formValue">
                                    <input id="Amount" name="Amount" type="text" class="form-control required" placeholder="请输入金额" />
                                </td>
                                @*<th class="formTitle">发布时间</th>
                                    <td class="formValue">
                                        <input id="SendTime" name="SendTime" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" style="margin-left: 2px" placeholder="请输入发布时间" />
                                    </td>*@
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
            @*<div class="step-pane" id="step-2">
                    <div id="permissionTree">111111111</div>
                </div>*@
        </div>
        @*<div class="form-button" id="wizard-actions">
                <a id="btn_finish" class="btn btn-default" style="display: none;" onclick="submitForm()">完成</a>
            </div>*@
    </div>
</form>
